package com.scc.generate.word.frame;

import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;

import javax.swing.JFrame;

/**
 * @ClassName: AutoChangeComponentAdapter
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @author chengcai.shang@cmgplex.com
 * @date 2023年3月31日 下午2:38:46
 * 
 */
public class AutoChangeComponentAdapter extends ComponentAdapter {
	private JFrame frame;

	/**
	 * <p>
	 * Title:
	 * </p>
	 * <p>
	 * Description:
	 * </p>
	 * 
	 * @author javascc@126.com
	 * @date 2023年3月31日 下午2:40:37
	 * @param frame
	 */
	public AutoChangeComponentAdapter(JFrame frame) {
		super();
		this.frame = frame;
	}

	@Override
	public void componentResized(ComponentEvent e) {
		int whidth = this.frame.getWidth();// 获取窗口宽度
		int height = this.frame.getHeight();// 获取窗口宽度
		// 将lable放在 窗口左边的1/3处
		PanelInitUtil.DRIVERCOMBOBOX.setBounds(140, 20, whidth - 110, 25);// (起始点x，起始点y，宽地w，高h) 标签设置宽高不明显
		// 将lable放在 窗口左边的1/2处
		PanelInitUtil.URLTEXTFIELD.setBounds(140, 50, whidth - 150, 25);// (起始点x，起始点y，宽地w，高h)
		// 宽度始终是窗口的1/2
		PanelInitUtil.UANMETEXTFIELD.setBounds(140, 80, whidth - 150, 25);// (起始点x，起始点y，宽地w，高h)
		PanelInitUtil.PASSWORDTEXTFIELD.setBounds(140, 110, whidth - 150, 25);// (起始点x，起始点y，宽地w，高h)
		PanelInitUtil.FILEPATHTEXTFIELD.setBounds(140, 140, whidth - 150, 25);// (起始点x，起始点y，宽地w，高h)
		PanelInitUtil.IGNORETABLENAMETEXTFIELD.setBounds(140, 170, whidth - 150, 25);// (起始点x，起始点y，宽地w，高h)
		PanelInitUtil.IGNOREPREFIXTEXTFIELD.setBounds(140, 210, whidth - 150, 25);// (起始点x，起始点y，宽地w，高h)
		PanelInitUtil.IGNORESUFFIXTEXTFIELD.setBounds(140, 250, whidth - 150, 25);// (起始点x，起始点y，宽地w，高h)
		PanelInitUtil.NAMETEXTFIELD.setBounds(140, 290, whidth - 150, 25);// (起始点x，起始点y，宽地w，高h)
		PanelInitUtil.VERSIONTEXTFIELD.setBounds(140, 330, whidth - 150, 25);// (起始点x，起始点y，宽地w，高h)
		PanelInitUtil.ENGINEFILETYPECOMBOBOX.setBounds(140, 370, whidth - 110, 25);// (起始点x，起始点y，宽地w，高h)
		PanelInitUtil.ISOPENDSCOMBOBOX.setBounds(140, 410, whidth - 110, 25);// (起始点x，起始点y，宽地w，高h)
		PanelInitUtil.JSP.setBounds(10, 490, whidth - 25, height - 530);// (起始点x，起始点y，宽地w，高h)
	}

}
